package org.idea.spring.ioc;

import org.idea.spring.ioc.bean.User;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @Author idea
 * @Date created in 2:36 下午 2020/4/19
 */
public class ApplicationTest {

    public static void main(String[] args) {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("beans.xml");
//        UserService2 userService2 = (UserService2) applicationContext.getBean("userService2");
//        userService2.find();
        for (int i=1;i<=3;i++){
            User user = (User) applicationContext.getBean("staticFactoryUser0"+i);
            System.out.println(user.toString());
        }
    }
}
